Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle the ticker from the banner design preview #517

Merged
merged 7 commits into from
Oct 16, 2023

Conversation

tjmw
Copy link
Member

@tjmw tjmw commented Oct 13, 2023

What does this change?

When live previewing a banner design, support toggling the ticker on and off (this setting usually comes from the variant, which is hardcoded in this case).

Screen Recording 2023-10-13 at 17 33 31 mov

How to test

Live preview a banner design (locally or in CODE). Toggle the ticker with the control which pops up.

How can we measure success?

Have we considered potential risks?

Images

Accessibility

tjmw added 5 commits October 13, 2023 17:56
We won't be showing the ticker toggle for any cases other than the
banner design preview.
@tjmw tjmw force-pushed the tw/banner-design-preview-toggle-ticker branch from c52ab2a to 4b0f771 Compare October 13, 2023 16:57
shouldShowTickerToggle?: boolean;
}

const DEFAULT_TICKER_SETTINGS: TickerSettingsWithData = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if instead of hardcoding this in here we could include tickerSettings in the variant data prop? And let useTickerData do its thing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've refactored to support this - most of the complexity around toggling the ticker is now outside of the BannerVariantPreview component. When toggled on for a design the ticker data is threaded through as part of the variant (as usual).

<BannerVariantPreview
variant={buildVariantForPreview(design, shouldShowTicker)}
design={design}
controls={
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link
Member

@tomrf1 tomrf1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@tjmw tjmw merged commit 03b7096 into main Oct 16, 2023
1 check passed
@tjmw tjmw deleted the tw/banner-design-preview-toggle-ticker branch October 16, 2023 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants